#region Copyright
/// <copyright>
/// Copyright (c) 2008 Ilia Shramko.
/// Released under the terms of the GNU General Public License.
/// </copyright>
#endregion

using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Runtime.InteropServices;
using System.Text;

namespace Osh.ViewRight
{
	[ConfigurationCollection(typeof(ProviderElement), AddItemName = "provider",
		CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
	[ClassInterface(ClassInterfaceType.None)]
	public class ProviderElementCollection : ConfigurationElementCollection, Osh.Configuration.IConfigurationElementCollection
	{
		public ProviderElementCollection()
		{
		}

		protected override ConfigurationElement CreateNewElement()
		{
			return new ProviderElement();
		}

		protected override object GetElementKey(ConfigurationElement element)
		{
			return ((ProviderElement)element).Name;
		}

		public void Add(ProviderElement element)
		{
			BaseAdd(element);
		}


		#region IConfigurationElementCollection Members
		public new int Count
		{
			get { return base.Count; }
		}

		public new IEnumerator GetEnumerator()
		{
			return base.GetEnumerator();
		}
		#endregion IConfigurationElementCollection Members
	}
}
